package com.ymk.mq;


import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * RabbitMQConfig.
 * 队列配置
 * Created by xiatl on 2018-07-23 10:28
 */
@Configuration
public class RabbitMQConfig {


    @Bean
    public FanoutExchange memberPostExchange() {
        return new FanoutExchange(RabbitmqCode.EXCHANGE_MEMBER_POST);
    }

    /**
     * 创建订单ORDER_QUEUE
     *
     * @return 队列
     */
    @Bean
    public Queue orderQueue() {
        return new Queue(RabbitmqCode.ORDER_QUEUE,true);
    }

    /**
     * 创建商品GOODS_QUEUE
     *
     * @return 队列
     */
    @Bean
    public Queue goodsQueue() {
        return new Queue(RabbitmqCode.GOODS_QUEUE,true);
    }

    /**
     * 创建会员MEMBER_QUEUE
     *
     * @return 队列
     */
    @Bean
    public Queue memberQueue() {
        return new Queue(RabbitmqCode.MEMBER_QUEUE,true);

    }

    /**
     * 创建消息NOTICE_QUEUE
     *
     * @return 队列
     */
    @Bean
    public Queue noticeQueue() {
        return new Queue(RabbitmqCode.NOTICE_QUEUE,true);
    }


    /**
     * 创建支付PAY_QUEUE
     *
     * @return 队列
     */
    @Bean
    public Queue payQueue() {
        return new Queue(RabbitmqCode.PAY_QUEUE,true);
    }

    /**
     * 创建统计CMD_QUEUE
     *
     * @return 队列
     */
    @Bean
    public Queue statQueue() {
        return new Queue(RabbitmqCode.STAT_QUEUE,true);
    }

    /**
     * 创建推广MKT_QUEUE
     *
     * @return 队列
     */
    @Bean
    public Queue mktQueue() {
        return new Queue(RabbitmqCode.MKT_QUEUE,true);
    }

}
